$("#fol").click(function(){
    $(".logins2").css("display","block")
})
$("#fol").click(function(){
    $(".logins").css("display","none")
})
$("#users").click(function(){
    $(".logins").css("display","block")
})
$("#users").click(function(){
    $(".logins2").css("display","none")
})



let uname = document.getElementById("username");
let upwd = document.getElementById("pwd");
let unameMsg = document.getElementById("unamemsg");
    let upwdMsg = document.getElementById("pwdmsg");
uname.addEventListener("blur",function(){
    //获取用户的输入
    let val=this.value;
    //定义正则表达式
    let reg =/^[a-zA-Z0-9_]{6,12}$/ ;
    let bool=reg.test( val)
    //验证通过
    if(bool){
        unameMsg.innerHTML="验证通过";
        unameMsg.style.color="orange";
        
        //修改变量的值
        unameFlag =true
        
    }else{
        unameMsg.innerHTML="验证失败";
        unameMsg.style.color="red";
        unameFlag =false;
    }
    console.log("user:",val,bool);
    
    
})
upwd.addEventListener("blur",function(){
    //获取用户的输入
    let val=this.value;
    //定义正则表达式
    let reg =/^[a-zA-Z0-9_]{6,12}$/ ;
    let bool=reg.test( val)
    //验证通过
    if(bool){
        upwdMsg.innerHTML="验证通过";
        upwdMsg.style.color="orange";
        this.style.borderColor="orange";
        upwdFlag = true;
        
    }else{
        upwdMsg.innerHTML="验证失败";
        upwdMsg.style.color="red";
        this.style.borderColor="red";
        upwdFlag = false;
    }
    console.log("pwd:",val,bool);
    
    
})
let unameFlag = false;
let upwdFlag =false;
   


document.getElementById("logo").onclick=function(){
    window.location="index.html"
}
document.getElementById("btn").onclick=function(){
    alert("暂未开放登录")
    window.location="login.html"
}

